import {get,post} from "@/api/request"
/**
 * 教师信息接口
 */
export const teacherApi ={
    addUrl(url){
        return '/easteacher/teacher'+url
    },
    getTeacherList(){
        return post(this.addUrl("/list"))
    },
    searchTeacher(data){
        return post(this.addUrl("/search"),data)
    },
    saveTeacher(data){
        return post(this.addUrl('/save'),data)
    },
    updateTeacher(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.saveTeacher(data)
        }else if(status =='update'){
            return this.updateTeacher(data)
        }
    },
    deleteTeacher(data){
        return post(this.addUrl('/delete'),data)
    },
    getTeacherInfo(id){
        return get(this.addUrl('/info/'+id))
    },
}
/**
 * 评教接口
 */
export const evaluationteachingApi={
    addUrl(url){
        return '/easteacher/evaluationteaching'+url
    },
    /**
     * 获取自己对老师的评价（学生用）
     * @param {*} data 
     * @returns 
     */
    getByTidAndSid(data){
        return post(this.addUrl('/getbytidandsid'),data)
    },
    /**
     * 查询教师综合评价，按学期
     */
    getByTid(data){
        return post(this.addUrl('/getbytid'),data)
    },
    list(data){
        return post(this.addUrl('/list'),data)
    },
    top(data){
        return post(this.addUrl('/gettop'),data)
    },
    Info(id){
        return get(this.addUrl('/info/'+id))
    },
    save(data){
        return post(this.addUrl('/save'),data)
    },
    update(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.save(data)
        }else if(status =='update'){
            return this.update(data)
        }
    },
    delete(data){
        return post(this.addUrl('/delete'),data)
    }
}
/**
 * 教师风采相关接口
 */
export const teacherstyleApi={
    addUrl(url){
        return '/easteacher/teacherstyle'+url
    },
    list(data){
        return post(this.addUrl('/list'),data)
    },
    Info(id){
        return get(this.addUrl('/info/'+id))
    },
    save(data){
        return post(this.addUrl('/save'),data)
    },
    update(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.save(data)
        }else if(status =='update'){
            return this.update(data)
        }
    },
    delete(data){
        return post(this.addUrl('/delete'),data)
    }
}

